package com.atiguigu.springcloud.clients;

import com.atguigu.springcloud.entity.CommonResult;
import com.atiguigu.springcloud.fallback.PaymentClientFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Author lizhilong
 * @create 2020/5/3 12:54
 * @desc
 */
@FeignClient(name = "CLOUD-PAYMENT-HYSTRIX-SERVICE",fallbackFactory = PaymentClientFallBack.class)
@Component
public interface PaymentClient {

    @GetMapping("/payment/ok/{id}")
    CommonResult<String> get(@RequestParam("id") Integer id);

    @GetMapping("/payment/timeout/{id}")
    CommonResult<String> getTimeout(@RequestParam("id") Integer id);

    @GetMapping("/payment/breaker/{id}")
    CommonResult<String> breakTest(@RequestParam("id") Integer id);
}
